package com.sywl.service.impl;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sywl.dao.BuildingDao;
import com.sywl.orm.Building;
import com.sywl.service.BuildingService;
import com.sywl.util.DataGridModel;

@Service("BuildingService")
@Transactional
public class BuildingServiceImpl implements BuildingService {
	
	@Resource(name="buildingDao")
	private BuildingDao buildingDao;

	public void save(Building entity) {
		buildingDao.save(entity);
	}

	public void update(Building entity) {
		buildingDao.update(entity);
	}

	public void delete(Serializable id) {
		buildingDao.delete(id);
	}

	public Building findById(Serializable id) {
		return buildingDao.findById(id);
	}

	public List<Building> getAll() {
		return buildingDao.getAll();
	}

	public List<Building> findByHQL(String hql, Object... params) {
		return buildingDao.findByHQL(hql, params);
	}
	
	public Map<String, Object> getPageList(DataGridModel dgm, Building building)
			throws Exception {
		return buildingDao.getPageList(dgm, building);
	}

	public Map<String, Object> getAssetByRoomId(DataGridModel dgm, int rId)
			throws Exception {
		return buildingDao.getAssetByRoomId(dgm, rId);
	}
}
